<?php
/* wwwschool project
Copyright (C) 2009  Phillip Aldridge
Email : info@imi21.com
Web site http://www.imi21.com
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

/**
 *
 *  wwwschool project
 *  File : WS3theme.php
 *  
 * CLASS WS3_Theme
 */  
 
 class WS3_Theme {
 
  private $id = null; 
  private $name = null; 
  private $description = null; 
  
  function __construct() {
   }
   
  function __destruct() {
   }
   
  // set Theme id
  function setThemeID($id=null) {
    
    $dbTheme = new WS3_Database();
    $theme_id = $dbTheme->makeSafeInt($id);   
    
    $q="SELECT * FROM `theme` WHERE 1 AND `id`= '$theme_id' LIMIT 1";
    if ($dbTheme->query($q) && $dbTheme->nextRecord() )
    {
      $this->id = $theme_id;
      $this->name = javaSafeString( $dbTheme->f('name') );
      $this->description = javaSafeString( $dbTheme->f('description') );

      return true;
    }else{
      return false;
    }
   }
   
  // return Theme id
  function ThemeID() {
    if ($this->id)
    return $this->id;
    else
    return false; 
   }
    
  // return Theme name
  function ThemeName() {
    if ($this->name)
    return $this->name;
    else
    return false; 
   }
   
   // return Theme description
  function ThemeDescription() {
    if ($this->description)
    return $this->description;
    else
    return false; 
   }

 } // end class
 
 ?>
